package com.thx.common.web.filter;

import com.thx.common.web.WebConstant;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 基础会话过滤器.
 *
 * @author 贾红磊
 */
public abstract class DefaultSessionFilter extends SessionFilter {

  @Override
  protected boolean checkSession(HttpSession session, HttpServletRequest request,
                                 HttpServletResponse response) {
    Object user = session.getAttribute(WebConstant.KEY_USER);
    return user != null;
  }

  @Override
  protected boolean checkPrivilege(HttpSession session,
                                   HttpServletRequest request, HttpServletResponse response) {
    return false;
  }

}
